home *** CD-ROM | disk | FTP | other *** search
- unit FileName;
- interface
- uses DsgnIntf;
-
- Type
- TFileNameProperty = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure Edit; override;
- end;
-
- implementation
- uses Dialogs, Forms;
-
- function TFileNameProperty.GetAttributes: TPropertyAttributes;
- begin
- Result := [paDialog]
- end {GetAttributes};
-
- procedure TFileNameProperty.Edit;
- begin
- with TOpenDialog.Create(Application) do
- try
- Title := GetName; { name of property as OpenDialog caption }
- Filename := GetValue;
- Filter := 'All Files (*.*)|*.*';
- HelpContext := 0;
- Options := Options + [ofShowHelp, ofPathMustExist, ofFileMustExist];
- if Execute then SetValue(Filename);
- finally
- Free
- end
- end {Edit};
- end.